 <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航菜单</title>
    <link rel="shortcut icon" href="__PUB__/favicon.ico"> 
    <link href="__CSS__/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__CSS__/animate.min.css" rel="stylesheet">
    <link href="__CSS__/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="__CSS__/page.css" rel="stylesheet">
    <script  src="__JS__/jquery.min.1.8.1.js" ></script>

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>导航列表</h5>
                        <div class="ibox-tools">
                            <a class="dropdown-toggle" data-toggle="dropdown" href="{:U('Nav/ad')}" title ="添加">
                                <i class="fa fa-file-text-o"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row">
                            
                           <form action="{:U('Nav/lst')}"  method ="post" >
                           <div class="col-sm-5 m-b-xs" style="width:300px;">
                                <select class="input-sm form-control input-s-sm inline" name="type">
                                    <option value="0">请选择</option>
									<volist name="nav_cat" id="vx"> 
										<if condition="$vx.level eq 0">
											<option value="{$vx.id}">{$vx.name}</option>
										<else/>
											<option value="{$vx.id}">|--{$vx.name}</option>
										</if>
									</volist>
                                </select>
                            </div>

                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input type="text" placeholder="请输入图片名称" class="input-sm form-control" name ="search"> 
                                    <span class="input-group-btn">
                                       <input type="submit" class="btn btn-sm btn-primary" value="搜索" />
                                    </span>
                                </div>
                            </div>
                            </form>
                        </div>
                        <form action="{:U('Nav/del_both')}"  method ="post"  >
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th><input type="checkbox" class="i-checks" id="checks_both" /></th>
                                        <th>图片ID</th>
                                        <th>图片名称</th>
                                        <th>图片标签</th>
                                        <th>状态</th>
                                        <th>分类</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <volist name="nav" id="vo">
	                                <tbody>
	                                    <tr>
	                                        <td>
	                                            <input type="checkbox"  class="i-checks ckeck"name="del_both[ ]" value="{$vo.id}" />
	                                        </td>
	                                        <td>{$vo.id}</td>
	                                        <td>{$vo.name}</td>
	                                        <td>{$vo.tags}</td>
	                                        <td>
		                                       <if condition="$vo[status] eq 1">
													<span style="color:Green">已显示</span>
		                                       <else/>
		                                       		<span style="color:red">未显示</span>
		                                       </if>
	                                        </td>
	                                        <td>
		                                        <volist name="nav_cat" id="v">
										       		<switch name="vo.classify">
										       			<case value="$v.id">{$v.name}</case>
										       		</switch>
									       		</volist>
									        </td>   
	                                        <td> 
	                                        <a href="{:U('Nav/edt',array('id'=>$vo['id']))}"title ="修改"><i class="fa fa-edit text-navy"></i></a>&nbsp;&nbsp;
	                                        <a href="{:U('Nav/del',array('id'=>$vo['id']))}"title ="删除"><i class="fa fa-times text-navy" onclick="return confirm('确定要删除吗？');"></i></a>
	                                        </td>
	                                    </tr>
	                                </tbody>
                                </volist>
                            </table>
                        </div>
                        <input type="submit" value="全部删除" onclick="return confirm('您确定要删除这些吗？');"class ="btn btn-sm btn-primary"/>
                        </form>
						
						<div class ="pagination">{$page}</div>
						
						
                    </div>
                </div>
            </div>

        </div>
    </div>
 
    <script>
  
    	$("#checks_both").click(function(){
       	 if($(this).attr("checked")){
    			$(".ckeck").attr("checked","checked");
    		}else{
    			$(".ckeck").removeAttr("checked");
    		}
    	})

        //首页显示
    	var i=0;
    	function recomme_index(id){  				
    		    if(i==0){
    		    	$('#'+id).removeClass('fa-times');
    		    	$('#'+id).addClass('fa-check');
    		        i=1;
    		        var is_index =1;
    		        $.post('recomme_index',{id:id,is_index:is_index},function(){
    		        	
    		        })
    		    }else{
    		    	var is_index=0;
    		        $.post('recomme_index',{id:id,is_index:is_index},function(){
    		        	
    		        })
    		    	$('#'+id).removeClass('fa-check');
    		    	$('#'+id).addClass('fa-times');
    		        i=0;
    		        
    		    }

    	}
    	//case页面优质项目显示
    	var cs=0;
    	function recomme_case(id){  				
    		    if(cs==0){
    		    	var is_case =1;
    		        $.post('recomme_case',{id:id,is_case:is_case},function(){
    		        	
    		        })
    		    	$('#case'+id).removeClass('fa-times');
    		    	$('#case'+id).addClass('fa-check');
    		        cs=1;
    		    }else{
    		    	$('#case'+id).removeClass('fa-check');
    		    	$('#case'+id).addClass('fa-times');
    		        cs=0;
    		    	var is_case =0;
    		        $.post('recomme_case',{id:id,is_case:is_case},function(){
    		        	
    		        })
    		    }

    	}
    	//首页显示
    	var c=0;
    	function recomme_index2(id){  				
		    if(c==0){

		    	$('#'+id).removeClass('fa-check');
		    	$('#'+id).addClass('fa-times');
		        c=1;
		    	var is_index =0;
		        $.post('recomme_index',{id:id,is_index:is_index},function(){
		        	
		        })
		    }else{

		    	$('#'+id).removeClass('fa-times');
		    	$('#'+id).addClass('fa-check');
		        c=0;
		    	var is_index =1;
		        $.post('recomme_index',{id:id,is_index:is_index},function(){
		        	
		        })
		    }

		}
    	//case页面优质项目显示
    	var cs2 =0;
    	function recomme_case2(id){
		    if(cs2==0){
		    	var is_case =0;
		        $.post('recomme_case',{id:id,is_case:is_case},function(){
		        	
		        })
		    	$('#case'+id).removeClass('fa-check');
		    	$('#case'+id).addClass('fa-times');
		        cs2=1;

		    }else{
		    	var is_case =1;
		        $.post('recomme_case',{id:id,is_case:is_case},function(){
		        	
		        })
		    	$('#case'+id).removeClass('fa-times');
		    	$('#case'+id).addClass('fa-check');
		        cs2=0;
    		}
    	}
		
    	//case页面排序
    	 function onblus(id){
    		    var id=id;
    			var sort=$("#sort" + id).val();
    		    $.post('change_sort',{id :id,sort:sort},function (data){
    		 	 
    			/*     if(data.status==0){
    		 			bootbox.alert(data.info);	
    				} */
    			 
  			   });
    			 
    		}
    </script>

</body>

</html>
